﻿package app 
{
	import flash.display.DisplayObject;
    import flash.display.Stage;
    import org.puremvc.as3.interfaces.IFacade;
    import org.puremvc.as3.patterns.facade.Facade;
    
    import app.controller.*;
    
    /**
    * ...
    * @author lzyy
    */
    public class ApplicationFacade extends Facade implements IFacade
    {
        public static const START_UP:String = 'start_up';
        public static const INIT:String = 'init';
        public static const NUMBTN_CLIKCED:String = 'numbtn_clicked';
        public static const IMG_CHANGED:String = 'img_changed';
        
        public function ApplicationFacade() 
        {
            
        }
        
        public function startup(root:DisplayObject)
        {
            sendNotification(START_UP, root);
        }
        
        override protected function initializeController( ) : void 
        {
            super.initializeController();
            registerCommand(START_UP, StartupCommand);
        }
        
        public static function getInstance()
        {
            if (instance == null) instance = new ApplicationFacade();
            return instance;
        }
        
    }
    
}